package com.zh.controller.app;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zh.pojo.domain.DriverAuthMaterial;
import com.zh.pojo.dto.DriverAuthDto;
import com.zh.result.JSONResult;
import com.zh.service.IDriverAuthMaterialService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

@Tag(name = "司机实名资料",description = "司机实名资料")
@RestController
@RequestMapping("/app/driverAuthMaterial")
public class AppDriverAuthMaterialController {

    @Autowired
    public IDriverAuthMaterialService driverAuthMaterialService;
    @Operation( summary= "实名申请",description = "实名申请")
    @Parameter(name = "driverAuthDto",description = "实名的对象",required = true)
    @PostMapping("/realAuth/apply")
    public JSONResult realAuthApply(@RequestBody @Valid DriverAuthDto driverAuthDto){
        driverAuthMaterialService.realAuthApply(driverAuthDto);
        return JSONResult.success();
    }
    @Operation( summary= "查询司机实名信息",description = "查询司机实名信息")
    @Parameter(name = "query",description = "查询条件",required = true)
    @GetMapping(value = "/current")
    public JSONResult selectByDriverAuthMaterial(){
        return JSONResult.success(driverAuthMaterialService.selectByDriverAuthMaterial());
    }
}
